package com.gh.ggkt.vod.api;

import com.atguigu.ggkt.model.vod.Course;
import com.gh.ggkt.vod.service.CourseService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Eric Fang
 * @date 2022/10/27 14:36
 */
@RestController
@RequestMapping("/api/vod/course")
public class CourseApiController {

    @Autowired
    private CourseService courseService;

    /**
     * 根据关键字查询课程信息
     */
    @ApiOperation("根据关键字查询课程信息")
    @GetMapping("/inner/findByKeyword/{keyword}")
    public List<Course> findByKeyword(@ApiParam(value = "关键字", required = true)
                                      @PathVariable String keyword) {
        List<Course> courseList = courseService.findByKeyword(keyword);
        return courseList;
    }
}
